import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue';
import { resolve } from "path"
//引入插件
import AutoImport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
export default defineConfig({
plugins: [
vue(),
//配置插件
AutoImport({
resolvers: [ ElementPlusResolver({
	importStyle: "sass",
	directives: true,
	// 可能需要添加以下配置以支持 $message 和其他全局 API
	imports: ["ElMessage", "ElMessageBox", "ElNotification"]
  })],
imports: ['vue', 'vue-router']
	}),
	Components({
	resolvers: [ElementPlusResolver()],
	}),
	],
resolve: {
// 配置路径别名
alias: {
'@': resolve(__dirname, './src'),
},
},
// 设置api代理
server:{
  proxy:{
  '/api':'http://127.0.0.1:5000' // 替换成你的域名
  }
}
});
